{% extends "admin/tree_change_list.html" %}
{% load i18n %}
{% block object-tools-items %}
<button id="exchange_menu" class="btn btn-danger">{% trans 'Exchange Menu' %}</button>
{{ block.super }}
{% endblock %}

{% block extrajs %}
{{ block.super }}
<script>
    $(function () {
        $('#exchange_menu').click(function () {
            $.get('{% url "admin:exchange_menu" %}', function (response) {
                console.log(response);
                if (response.message === 'success') {
                    window.location.reload();
                }
            })
        })
    });
</script>
{% endblock %}